;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  DragonballTypes
;  script file for PalmDebugger
;
;  This file should have any useful macros for the debugger.
;  Examples of this are structures for the register maps in 
;  the processors, the globals, and other data formats.
;
;  History
;  Creator and origin unknown
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; These MPW script lines will do most of the work of converting
;   a C Structure type to Debugger format
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;find 
;replace  -c  /([A-Za-z]+)2[ t]+([_a-zA-Z0-9[]-]+)1;/ "> 2 "1""
;find 
;replace -c  //// ""
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DragonBall EZ definitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
typedef struct "HwrDBallEZCSType"
	> UInt16 "csAGroupBase"
	> UInt16 "csBGroupBase"
	> UInt16 "csCGroupBase"
	> UInt16 "csDGroupBase"
	> UInt8 "___filler6"[8] \-
	> UInt16 "csASelect"
	> UInt16 "csBSelect"
	> UInt16 "csCSelect"
	> UInt16 "csDSelect"
	> UInt16 "emuCS"
	> UInt8 "___filler2"[E6] \-
	typeend
	
	
typedef struct "HwrDBallEZPLLType"
	> UInt16 "pllControl"
	> UInt16 "pllFreqSel"
	> UInt16 "pllTest"
	> UInt8 "__filler44" \-
	> UInt8 "pwrControl"
	> UInt8 "___filler3"[F8] \-
	typeend
	
typedef struct "HwrDBallEZINTType"
	> UInt8 "intVector"
	> UInt8 "___filler4" \-
	> UInt16 "intControl"
	> UInt16 "intMaskHi"
	> UInt16 "intMaskLo"
	> UInt8 "___filler7"[4] \-
	> UInt16 "intStatusHi"
	> UInt16 "intStatusLo"
	> UInt16 "intPendingHi"
	> UInt16 "intPendingLo"
	> UInt8 "___filler4a"[EC] \-
	typeend
	
	
typedef struct "HwrDBallEZPIOType"
	> UInt8 "portADir"
	> UInt8 "portAData"
	> UInt8 "portAPullupEn"
	> UInt8 "___filler8"[5] \-
	
	> UInt8 "portBDir"
	> UInt8 "portBData"
	> UInt8 "portBPullupEn"
	> UInt8 "portBSelect"
	
	> UInt8 "___filler9"[4] \-
	
	> UInt8 "portCDir"
	> UInt8 "portCData"
	> UInt8 "portCPulldnEn"
	> UInt8 "portCSelect"
	
	> UInt8 "___filler10"[4] \-
	
	> UInt8 "portDDir"
	> UInt8 "portDData"
	> UInt8 "portDPullupEn"
	> UInt8 "portDSelect"
	> UInt8 "portDPolarity"
	> UInt8 "portDIntReqEn"
	> UInt8 "portDKbdIntEn"
	> UInt8 "portDIntEdge"
	
	> UInt8 "portEDir"
	> UInt8 "portEData"
	> UInt8 "portEPullup"
	> UInt8 "portESelect"
	
	> UInt8 "___filler14"[4] \-
	
	> UInt8 "portFDir"
	> UInt8 "portFData"
	> UInt8 "portFPullup"  
	> UInt8 "portFSelect"
	
	> UInt8 "___filler16"[4] \-
	
	> UInt8 "portGDir"
	> UInt8 "portGData"
	> UInt8 "PortGPullup"
	> UInt8 "portGSelect"
	
	> UInt8 "___filler2000"[CC] \-
	typeend
	
	
typedef struct "HwrDBallEZPWMType"
	> UInt16 "pwmControl"
	> UInt16 "pwmSample"
	> UInt8 "___filler17"[2] \-
	> UInt16 "pwmCounter"
	> UInt8 "___filler24"[F8] \-
	typeend
	
typedef struct "HwrDBallEZTimerType"
	> UInt16 "tmr1Control"
	> UInt16 "tmr1Prescaler"
	> UInt16 "tmr1Compare"
	> UInt16 "tmr1Capture"
	> UInt16 "tmr1Counter"
	> UInt16 "tmr1Status"
	
	> UInt8 "___filler18"[C] \-

	> UInt16 "wdControl"
	> UInt16 "wdReference"
	> UInt16 "wdCounter"
	
	> UInt8 "___filler25"[1E2] \-
	typeend	
	
	
typedef struct "HwrDBallEZWDType"
	> UInt16 "wdControl"
	> UInt16 "wdReference"
	> UInt16 "wdCounter"
	typeend	
		
typedef struct "HwrDBallEZSPIType"
	> UInt16 "spiMasterData"
	> UInt16 "spiMasterControl"
	
	> UInt8 "___filler27"[FC] \-
	typeend
	
typedef struct "HwrDBallEZUARTType"
	> UInt16 "uControl"
	> UInt16 "uBaud"
	> UInt16 "uReceive"
	> UInt16 "uTransmit"
	> UInt16 "uMisc"
	> UInt8 "___filler28"[F6] \-
	typeend
	
typedef struct "HwrDBallEZLCDType"
	> UInt32 "lcdStartAddr"
	> UInt8 "___filler29" \-
	> UInt8 "lcdPageWidth"
	> UInt8 "___filler30"[2] \-
	> UInt16 "lcdScreenWidth"
	> UInt16 "lcdScreenHeight"
	> UInt8 "___filler31"[0C] \-
	> UInt16 "lcdCursorXPos"
	> UInt16 "lcdCursorYPos"
	> UInt16 "lcdCursorWidthHeight"
	> UInt8 "___filler32" \-
	> UInt8 "lcdBlinkControl"
	> UInt8 "lcdPanelControl"
	> UInt8 "lcdPolarity"
	> UInt8 "___filler33" \-
	> UInt8 "lcdACDRate"
	> UInt8 "___filler34" \-
	> UInt8 "lcdPixelClock"
	> UInt8 "___filler35" \-
	> UInt8 "lcdClockControl"
	> UInt8 "___filler36" \-
	> UInt8 "lcdRefreshRateAdj"
	> UInt8 "___filler2003"[3] \-
	> UInt8 "lcdPanningOffset"
	> UInt8 "___filler37"[3] \-
	> UInt8 "lcdFrameRate"
	> UInt8 "___filler2004" \-
	> UInt8 "lcdGrayPalette"
	> UInt8 "lcdReserved"
	> UInt8 "___filler2005" \-
	> UInt16 "lcdContrastControlPWM"
	> UInt8 "___filler40"[c8] \-
	typeend
	
typedef struct "HwrDBallEZRTCType"
	> UInt32 "rtcHourMinSec"
	> UInt32 "rtcAlarm"
	> UInt8 "_filler2001"[2] \-
	> UInt16 "rtcWatchDog"
	> UInt16 "rtcControl"
	> UInt16 "rtcIntStatus"
	> UInt16 "rtcIntEnable"
	> UInt16 "stopWatch"
	> UInt8 "_filler2002"[6] \-
	> UInt16 "rtcDay"
	> UInt16 "rtcDayAlarm"
	> UInt8 "___filler41"[E2] \-
	typeend
	
typedef struct "HwrDBallEZDramCtlType"
   > UInt16 "DramConfig"
	> UInt16 "DramControl"
	> UInt8 "___filler42"[FC] \-
	typeend
				
typedef struct "HwrDBallEZEMUType"
	> UInt32 "emuAddrCompare"
	> UInt32 "emuAddrMask"
	> UInt16 "emuControlCompare"
	> UInt16 "emuControlMask"
	> UInt16 "emuControl"
	> UInt16 "emuStatus"
	typeend
	
typedef struct "HwrDBallEZType"

	> UInt8 "scr"
	> UInt8 "___filler0"
	> UInt8 "chipID"
	> UInt8 "maskID"
	> UInt16 "swID"
	> UInt8 "___filler1"[FA] \-
	
	> HwrDBallEZCSType "Chip Select"
	

	> HwrDBallEZPLLType "PLL"
	
	
	> HwrDBallEZINTType "INT"
	
	
	> HwrDBallEZPIOType "PIO"
	
	
	> HwrDBallEZPWMType "PWM"
	
	
	> HwrDBallEZTimerType "Timer"
	
	
	> HwrDBallEZSPIType "SPI"
	
	
	> HwrDBallEZUARTType "UART"
	
	
	> HwrDBallEZLCDType "LCD"
		
	
	> HwrDBallEZRTCType "RTC"
	
	
	> HwrDBallEZDramCtlType "DRAM Controller"
	
	
	> HwrDBallEZEMUType "EMU Control"
	
	typeend



	
;################################################################
; Macros
;##############################################################
alias "DragonBallEZ" "dm FFFFF000 HwrDBallEZType"
alias "EZCS" 			"dm FFFFF100 HwrDBallEZCSType"
alias "EZPLL" 			"dm FFFFF200 HwrDBallEZPLLType"
alias "EZINT" 			"dm FFFFF300 HwrDBallEZINTType"
alias "EZPIO" 			"dm FFFFF400 HwrDBallEZPIOType"
alias "EZPWM" 			"dm FFFFF500 HwrDBallEZPWMType"
alias "EZTimer" 		"dm FFFFF600 HwrDBallEZTimerType"
alias "EZSPI" 			"dm FFFFF800 HwrDBallEZSPIType"
alias "EZUART" 		"dm FFFFF900 HwrDBallEZUARTType"
alias "EZLCD" 			"dm FFFFFA00 HwrDBallEZLCDType"
alias "EZRTC" 			"dm FFFFFB00 HwrDBallEZRTCType"
alias "EZDRAM"			"dm FFFFFC00 HwrDBallEZDramCtlType"
alias "EZEMU"			"dm FFFFFD00 HwrDBallEZEMUType"
